package com.seaengine.actor.anibmp.effectbmp
{
	import com.seaengine.actor.anibmp.BaseBmpMgr;
	import com.seaengine.actor.anibmp.BaseBmpNodeInfo;

	public class EffectBmpMgr extends BaseBmpMgr
	{
		private var m_EffectNodeInfos:Object;
				
		public function EffectBmpMgr(_id:int,_xml:XML,_SuccessFn:Function)
		{
			m_EffectNodeInfos = {};
			super(_id,_xml,_SuccessFn);
			
		}
		
		protected override function genAnimationInfo(_xml:XML):void
		{
			m_EffectNodeInfos[_xml.@id] = new EffectAnimationNodeInfo(_xml.@fps,_xml.@loop);
			var _ar:Array = new Array();
			for each( var en:XML in _xml.*)
			{
				_ar.push( new EffectFrameNodeInfo(en.@num,en.@ax,en.@ay));			
			}
			m_FrameInfos[_xml.@id] = _ar;	
		}
		
		public override function getNodeInfo(_animationId:int):BaseBmpNodeInfo
		{
			if(m_animationBmps[_animationId] == null)
				return null;
				
			return new EffectBmpNodeInfo(_animationId,m_animationBmps[_animationId],m_EffectNodeInfos[_animationId],m_FrameInfos[_animationId]);
		
		}
	}
}